package com.tan.simpleweather.base

import androidx.room.*
import java.io.Serializable


/**

@author： TanJun
@date： 2021/11/15 16:53
@description： TODO
@modifiedBy：
@version: 1.0
 */
@Entity(tableName = "place_item")
data class PlaceBean(
    val name: String,
    val lng: String,
    val lat: String,
    val address: String
):Serializable{
    @PrimaryKey(autoGenerate = true)
    var id:Int = 0
}

@Dao
interface PlaceDao{
    @Insert(entity = PlaceBean::class, onConflict = OnConflictStrategy.REPLACE)
    fun insertPlace(item: PlaceBean)

    @Query(value = "select * from place_item")
    fun queryAll(): List<PlaceBean>

    @Delete
    fun delete(placeBean: PlaceBean)
}
